count subarrays of length three with a condition

welcome to shbcf.ru